﻿namespace VisitorPatternCode
{
	public class MyClass : IClass<MultiplicationVisitor>, IClass<DivisionVisitor>
	{
		private readonly int _first;
		private readonly int _second;

		public int First
		{
			get { return _first; }
		}

		public int Second
		{
			get { return _second; }
		}

		public int Result { get; private set;}

		public MyClass(int first, int second)
		{
			_first = first;
			_second = second;
			Result = 0;
		}

		public void Accept(MultiplicationVisitor v)
		{
			Result = v.Visit(this);
		}

		public void Accept(DivisionVisitor v)
		{
			Result = v.Visit(this);
		}
	}
}
